﻿using AntdUI;
using FreeSql.DataAnnotations;
using WenAntdUI.Components;

namespace WenAntdUI.Models
{
    [Table(Name = nameof(SysMenu))]
    public class SysMenuDto : SysMenu
    {
        [DisplayName("页面控件")]
        [Col(EditTemplate = typeof(MenuControlTypeSelect))]
        public new string? ControlType { get => base.ControlType; set => base.ControlType = value; }
        /// <summary>
        /// 树结构子数据
        /// </summary>
        [Navigate(nameof(ParentCode))]
        public new List<SysMenuDto>? Child { get; set; }

        /// <summary>
        /// 子数据
        /// </summary>
        public SysMenuDto[] Childs => Child?.ToArray();


        [DisplayName("图标")]
        public CellImage IconImage => new(this.Icon);
    }
}
